package com.freemyleft.left.left_app.mian.index.my.Mystudent;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.freemyleft.left.left_app.R;
import com.freemyleft.left.zapp.ui.recycler.MultipleItemEntity;
import com.freemyleft.left.zapp.ui.recycler.MultipleRecyclerAdapter;
import com.freemyleft.left.zapp.ui.recycler.MultipleViewHolder;

import java.util.List;

public class MyStudentAdapter extends MultipleRecyclerAdapter{
    public  static  final int STUDENT_TYPE=331;
    protected MyStudentAdapter(List<MultipleItemEntity> data) {
        super(data);
        addItemType(STUDENT_TYPE, R.layout.item_student);
    }
    @Override
    protected void convert(MultipleViewHolder holder, MultipleItemEntity entity) {
        super.convert(holder, entity);
        String name=entity.getField(StudendFlies.NAME);
        String id=entity.getField(StudendFlies.ID);
        String xingyong=entity.getField(StudendFlies.XING_YONG);
        String head=entity.getField(StudendFlies.HEAD);
        holder.setText(R.id.tv_name,name);
        holder.setText(R.id.student_id,id);
        holder.setText(R.id.tv_credit,xingyong);
        Glide.with(mContext).load(head).into((ImageView) holder.getView(R.id.student_photo));
    }
    public enum StudendFlies{
        NAME,ID,XING_YONG,HEAD

    }
}
